{extend name="public:base" /}
{block name="action"}
<a type="button" class="btn btn-w-m btn-primary"
   href="{:url('dc')}">  导出
</a>
{/block}
{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight" xmlns="http://www.w3.org/1999/html">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-content">
                    <form method="get">
                        <div class="row">
                            <div class="col-sm-3">
                                <select class="form-control m-b" name="sealId" placeholder="印章名称">
                                    <option value="" {if condition="!$params.sealId" } selected {/if}>所有</option>
                                    {volist name="seals" id="entity"}
                                    <option value="{$entity.id}" {eq name="entity.id" value="$params.sealId"} selected {/eq}>{$entity.name}</option>
                                    {/volist}
                                </select>
                            </div>
                            <div class="col-sm-2">
                                <div class="input-group">
                                    <select class="form-control m-b" name="status">
                                        <option value="" {if condition="!$params.status" } selected {/if}>所有</option>
                                        {volist name="statuses" id="entity"}
                                        <option value="{$entity.id}" {eq name="entity.id" value="$params.status" } selected {/eq}>{$entity.name}</option>
                                        {/volist}
                                    </select>
                                    <span class="input-group-append">
                                    <button type="submit" class="btn btn-sm btn-primary"><i class="fa fa-search"></i> 搜索</button>
                                </span>
                                </div>
                            </div>
                        </div>
                    </form>
                    <table class="table table-stripped ">
                        <thead>
                        <tr>
                            <th width="5%">#</th>
                            <th width="20%">印章名称</th>
                            <th width="10%">审批类型</th>
                            <th width="25%">文件名称</th>
                            <!-- <th>申请单号</th> -->
                            <th width="10%">申请用章次数</th>
                            <th width="5%">状态</th>
                            <th width="10%">申请时间</th>
                            <th width="15%">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {notempty name="list"}
                        {volist name="list" id="vo" key="k"}
                        <tr>
                            <td>{$k}</td>
                            <td>{$vo.seal.name}</td>
                            <td>{$vo.approval.type_name}</td>
                            <td>{$vo.name}</td>
                            <!-- <td></td> -->
                            <td>{$vo.frequency}</td>
                            <td>{$vo.status_txt}</td>
                            <td>{$vo.create_time}</td>
                            <td class="project-actions text-right">
                                {eq name="vo.un_finished" value="true"}
                                <a href="{:url('delete', ['id' => $vo['id']])}" class="btn btn-danger btn-sm ajax-del"><i class="fa fa-trash-o"></i> 删除 </a>
                                {/eq}
                                <a href="{:url('processFlows', ['id' => $vo.id])}"
                                   class="btn  btn-warning btn-sm process-flow-btn-dialog"> 流程
                                </a>
                                <a href="{:url('show', ['id' => $vo['id']])}" class="btn btn-primary btn-sm detail"><i class="fa fa-eye"></i> 详情 </a>
                            </td>
                        </tr>
                        {/volist}
                        {/notempty}
                        </tbody>
                    </table>
                    {$list->render()}
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="js"}
<script type="text/javascript">
    $(".process-flow-btn-dialog").on("click", function (e) {
        e.preventDefault();
        $.get($(e.currentTarget).attr("href"), function (data) {
            new ModalDialog({
                content: data,
                closeBtn: false,
                success: function (data) {
                    return true;
                }
            }).show();
        })
    });
</script>
{/block}
{block name="css"}
<link rel="stylesheet" href="__ADMIN__/css/process-timeline.css">
{/block}